package tg.edu.fhh.demo.repository;


import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import tg.edu.fhh.demo.custom.BaseRepository;
import tg.edu.fhh.demo.entity.Course;
import tg.edu.fhh.demo.entity.Grade;


@Repository
public interface GradeRepository extends BaseRepository<Grade, Integer> {
	
    @Query(value ="select distinct g.course from Grade g where g.student.tbClass.id=?1")
	public List<Course> findCourseByTbClassId(Integer bjId);

	public Grade findByStudentIdAndCourseId(Integer id,Integer kcId);

	public List<Grade> findByStudentId(Integer id);
}
